import u from "@/plugins/comm"
export default async function (ctx) {
  // 获取友情链接
  let getlinks = await u.http({
    url: ctx.store.state.links,
    method: 'GET'
  })
  if (getlinks.code == 200) {
    ctx.links = getlinks.data
  }
  // 基础信息
  let getSetting = await u.http({
    url: ctx.store.state.getbaseconfig,
    method: 'GET'
  })
  if (getSetting.code == 200) {
    getSetting.data.logo = getSetting.data.logo
    getSetting.data.consult_qrcode_1 = getSetting.data.consult_qrcode_1
    getSetting.data.consult_qrcode_2 = getSetting.data.consult_qrcode_2
    // getSetting.data.logo = u.imgPrefixed + getSetting.data.logo
    // getSetting.data.consult_qrcode_1 = u.imgPrefixed + getSetting.data.consult_qrcode_1
    // getSetting.data.consult_qrcode_2 = u.imgPrefixed + getSetting.data.consult_qrcode_2
    ctx.configs = getSetting.data
  }
  // 导航
  ctx.navData = [
    { name: '首页', href: '/' },
    { name: '报考流程', href: '/bklc/' },
    { name: '证书查询', href: '/zscx/' },
    { name: '考证资讯', href: '/kzzx/' },
    { name: '在线报名', href: '/zxbm/' },
    { name: '学历提升', href: '/xlts/' }
  ]
}